#include<cstdio>
const double EPS=1e-10;
struct point 
{
	double x,y;
};
struct vector
{
	point start,end;
};
double abs(double x)
{
	if(x<0)return -x;
	return x;
}
double multi(point p1,point p2,point p0)//P0P1 叉乘P0P2
{
	return (p1.x-p0.x)*(p2.y-p0.y)-(p2.x-p0.x)*(p1.y-p0.y);
}

int main()
{
	int n;
	scanf("%d",&n);
	printf("INTERSECTING LINES OUTPUT\n");
	for(int i=1;i<=n;i++)
	{
		int x1,x2,x4,x3,y1,y2,y3,y4,kind;
		vector v,u;
		scanf("%d%d%d%d%d%d%d%d",&x1,&y1,&x2,&y2,&x3,&y3,&x4,&y4);
		u.start.x=x1;u.start.y=y1;u.end.x=x2;u.end.y=y2;
		v.start.x=x3;v.start.y=y3;v.end.x=x4;v.end.y=y4;
		if((x2-x1)*(y4-y3)==(x4-x3)*(y2-y1))
		{
			if(x1!=x2)
			{
				double b1=(y1-y2)/((double)x2-x1)*x1+y1;
				double b2=(y3-y4)/((double)x4-x3)*x3+y3;
				if(abs(b1-b2)<EPS)kind=1;
				else kind=2;
			}
			else
			{
				if(x1==x3)kind=1;
				else kind=2;
			}
			if(kind==1)printf("LINE\n");
			else printf("NONE\n");
		}
		else
		{
			double x,y;
			x=(multi(v.end,u.end,u.start)*v.start.x-multi(v.start,u.end,u.start)*v.end.x)/(multi(v.end,u.end,u.start)-multi(v.start,u.end,u.start));
			y=(multi(v.end,u.end,u.start)*v.start.y-multi(v.start,u.end,u.start)*v.end.y)/(multi(v.end,u.end,u.start)-multi(v.start,u.end,u.start));			
			printf("POINT %0.2f %.2f\n",x,y);
		}
	}
	printf("END OF OUTPUT\n");
	return 0;
}

		
